﻿<?xml version="1.0" encoding="utf-8"?><html><title>LINQ to XSD Mapping Documentation</title><body><center><h1>LINQ to XSD Mapping Documentation</h1></center><h3><font color="red">
      Important: You must accept the enclosed license terms
      before you can use this pre-release software.  If you do not accept the
      License Terms, you are not authorized to use this pre-release software. The
      License Terms are included in the distribution of this software.</font></h3><br /><P /><h3>Who should read this?</h3>

    The following document systematically describes the mapping of XML schemas to
    .NET object models. The normal user of the LINQ to XSD technology is not
    necessarily assumed to work with this documentation. The idea is that the
    implemented mapping is mostly intuitive and that intellisense and object
    browsing provide sufficient help for the developer. The documentation mainly
    serves as an informal specification.

    <br /><P />

    Notice: LINQ to XSD is an incubation project on typed XML programming carried out
    at Microsoft. LINQ to XSD is not scheduled to ship as a product. It is
    important to note that this release is being exposed to customers so as
    to gather their feedback on the typed XML programming experience. Any
    future products in this space may or may not be similar to LINQ to XSD.
    See the license terms for details.

    <br /><P /><br /><P /><h3>Notational conventions for OO APIs</h3><br /><P />

    The resulting .NET classes are described in C#-like pseudo code so as to hide routine technicalities.
    <UL><LI>All shown classes and members are implicitly public.</LI><LI>Hence, the keyword <code>public</code> is universally omitted.</LI><LI>Constructors are marked by the keyword <code>constructor</code> -- for clarity.</LI><LI>We are not using C#'s verbose notation "<code>static explicit operator</code>".</LI><LI>Instead we use the short notation <code>explicit cast</code>.</LI><LI>We elide the implementations of all property members.</LI><LI>To this end, we use "interface notation": <code>{ get; set; }</code>.</LI></UL><br /><P /><h3>OO API (Illustration of notation)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Foo<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Foo</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Foo</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Bar</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p><BR /><p /><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Table of contents</h2><ul><li><a href="#abstr">Global types and elements</a><ul><li><a href="#ctd">Complex-type definitions</a></li><li><a href="#ac-root">Roots with anonymous, complex types</a></li><li><a href="#nc-root">Roots with type references to complex types</a></li><li><a href="#std">Simple-type definitions</a></li><li><a href="#as-root">Roots with anonymous, simple types</a></li><li><a href="#ns-root">Roots with type references to simple types</a></li></ul></li><li><a href="#content">Content models</a><ul><li><a href="#seq1">Flat sequences</a></li><li><a href="#references">Type and element references</a></li><li><a href="#optional">Optional elements</a></li><li><a href="#repeating">Repeating elements</a></li><li><a href="#attributes">Attributes</a></li><li><a href="#choice">Flat choices</a></li><li><a href="#recurrent">Recurrent element names</a></li><li><a href="#nested">Nested content models</a></li><li><a href="#ano">Anonymous types</a></li><li><a href="#fixdef">Fixed and default values</a></li><li><a href="#wild">Wildcards</a></li></ul></li><li><a href="#substitution">Substitution forms</a><ul><li><a href="#ct-extension">Complex-type extension</a></li><li><a href="#st-extension">Extension of simple content</a></li><li><a href="#st-restriction">Simple-type restriction</a></li><li><a href="#ct-restriction">Complex-type restriction</a></li><li><a href="#subst">Susbstitution groups</a></li><li><a href="#control">Control of substitutability</a></li></ul></li><li><a href="#trivia">Trivially mapped XSD constructs</a><ul><li><a href="#group">Group definitions</a></li><li><a href="#gad">Global attribute declarations</a></li><li><a href="#gagd">Global attribute-group definitions</a></li><li><a href="#redefine">Redefinitions</a></li><li><a href="#identity">Identity constraints</a></li><li><a href="#mixed">Mixed content</a></li></ul></li><li><a href="#builtin">Appendix: Mapping of built-in simple types</a></li><li><a href="#name">Appendix: Name mapping</a></li><li><a href="#namespace">Appendix: Namespace mapping</a></li><li><a href="#samples">Appendix: More samples</a><ul><li><a href="#orders">Purchase orders</a></li><li><a href="#invoice">Invoices for orders</a></li><li><a href="#company">Company organization</a></li><li><a href="#language">Language syntax</a></li></ul></li></ul><font><a name="abstr"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h1>Global types and elements</h1><h2>Subsections</h2><p><ul><li><a href="#ctd">Complex-type definitions</a></li><li><a href="#ac-root">Roots with anonymous, complex types</a></li><li><a href="#nc-root">Roots with type references to complex types</a></li><li><a href="#std">Simple-type definitions</a></li><li><a href="#as-root">Roots with anonymous, simple types</a></li><li><a href="#ns-root">Roots with type references to simple types</a></li></ul><h2>Further reading</h2><UL><LI><a href="#substitution">
              XSD's forms of element and type substitution
            </a>
          are discussed separately.
        </LI><LI><a href="#trivia">Some other abstraction forms</a> such 
          as attribute declarations are mapped trivially.
        </LI></UL><!-- **************************************************************************** --><font><BR /><a name="ctd"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Complex-type definitions</h2><p>

          Complex-type definitions are mapped to classes.
          <BR />
          Each generated class comprises the following members:
          <UL><LI>a default constructor;</LI><LI>an explicit cast from <code>XElement</code> to the defined class;</LI><LI>some inherited API members such as <code>Save</code>; see the LINQ to XSD manual;</LI><LI>further members depending on the content model.</LI></UL>
          The class that is generated for a complex type subclasses <code>XTypedElement</code>.
          <BR />
          In fact, a derived complex-type is mapped to a subclass of the class that is generated for its base type.

          <h3>Schema sample (Complex-type definitions)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A complex type for addresses </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> address details omitted </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Address<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Address</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Address</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><font /><tr><td>}</td></tr></table></font></p></p></a></font><!-- **************************************************************************** --><font><BR /><a name="ac-root"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Roots with anonymous, complex types</h2><p>
          
          We use the term "root" to refer to global element declarations in an XML schema.
          <BR />
          We recall that a valid instance must be necessarily rooted in an element of that kind.
          <BR />
          Such roots are essentially mapped in the same way as complex-type definitions.
          
          <h3>Schema sample (Roots with anonymous, complex types)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A global element declaration for addresses </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> address details omitted </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Address<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Address</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Address</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><font /><tr><td>}</td></tr></table></font></p>

          The conceptual difference between complex-type definitions 
          and root element declarations is worth recalling: The latter define
          proper types in the sense of sets of elements, whereas the former model
          "incomplete" elements because element tags are not prescribed. This
          conceptual difference is reflected in the <I>behavior</I> of the 
          generated object types. That is, the complex-type name serves
          as "preliminary" element tag for any instance of the class that
          corresponds to the complex type in question; this preliminary tag
          is eventually resolved to a proper element tag, when the instance
          is parented or when it is wrapped in a root element.
          <FONT COLOR="red"><b>Note:</b> 
            Save and Load members are potentially misleading for classes that
            were generated from complex-type definitions since de-/serialization is
            only well-defined for root-element declarations. It is conceivable
            that a future release of LINQ to XSD makes explicit the conceptual
            difference between complex-type definitions and root element declarations.
          </FONT></p></a></font><!-- **************************************************************************** --><font><BR /><a name="nc-root"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Roots with type references to complex types</h2><p>

          This pattern makes combined use of a complex-type definition and a global element declaration.

          <h3>Schema sample (Roots with type references to complex types)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">BillTo</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">ShipTo</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> ... </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>

          This style is mapped as follows:
          <UL><LI>The following classes are generated in this case:</LI><br /><UL><LI>There is one class for each element declaration ("the envelope").</LI><LI>There is one class for each complex type ("the content").</LI></UL><LI>Envelopes can be constructed from content by means of a non-default constructor.</LI><LI>The content can be extracted from the envelope by means of the <code>Content</code> member.</LI><LI>The "envelope" class implements the API of the "content" class by forwarding.</LI></UL><h3>OO API (Roots with type references to complex types)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Address<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Address</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Address</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> BillTo<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>BillTo</font>();</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>BillTo</font>(<font><font>Address</font> content</font>);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>BillTo</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Address</font></td><td>  </td><td>Content</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>;  }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> ShipTo<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>ShipTo</font>();</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>ShipTo</font>(<font><font>Address</font> content</font>);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>ShipTo</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Address</font></td><td>  </td><td>Content</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>;  }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p>

          The combined use of element declarations and complex-type definitions leads
          to potentially convoluted object models, when the most direct mapping is
          applied. Hence, this usage pattern of XSD may suggest schema normalizations.
          <FONT COLOR="red"><b>Note:</b> The current release of LINQ to XSD does not yet provide any relevant
          schema normalization.</FONT></p></a></font><!-- **************************************************************************** --><font><BR /><a name="std"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Simple-type definitions</h2><p><h3>Schema sample (Simple-type definitions)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:simpleType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Month</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:token</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> restriction facets omitted </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:simpleType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>

          By default, simple-type definitions are not mapped to any class that the
          programmer is supposed to instantiate. <FONT COLOR="red"><b>Note:</b> The current release of LINQ
          to XSD generates a vacuous class for each simple-type definition. This
          class should be omitted.</FONT> By customization, one can also request
          a class that is designated to a simple-type definition. <FONT COLOR="red"><b>Note:</b> This option
          not supported by the current release of LINQ to XSD.</FONT> The use of
          designated classes offers two benefits: (i) simple-type names from the
          XML schema can be used in program code; (ii) substitutability for simple
          types (say, subtyping in OO terms) can be precisely expressed.
        </p></a></font><!-- **************************************************************************** --><font><BR /><a name="as-root"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Roots with anonymous, simple types</h2><p>

          Root element declarations (with anonymous types or not) are mapped to classes.
          
          <h3>Schema sample (Roots with anonymous, simple types)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Month</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:simpleType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> restriction facets omitted </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:simpleType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Month<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Month</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Month</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>TypedValue</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p>

          The (simple) content of such root elements can be access with
          a designated <code>TypedValue</code> property (akin to LINQ to XML's
          untyped value property). The type of this property
          is the built-in base type of the anonymous simple type. As usual,
          the class also provides an explicit coercion (cast) from
          <code>XElement</code> to the class.

        </p></a></font><!-- **************************************************************************** --><font><BR /><a name="ns-root"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Roots with type references to simple types</h2><p><h3>Schema sample (Roots with type references to simple types)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Month</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">MonthType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:simpleType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">MonthType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> restriction facets omitted </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:simpleType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Month<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Month</font>();</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Month</font>(<font><FONT COLOR="blue">string</FONT> content</font>);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Month</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>TypedValue</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p>

          The (simple) content of such root elements can be access with a designated
          <code>TypedValue</code> property (akin to LINQ to XML's untyped value property).
          The type of this property is the OO counterpart for the built-in XSD base type of
          the referenced simple type. As usual, the class also provides an explicit coercion
          (cast) from <code>XElement</code> to the class.

        </p></a></font></p></a><BR /></font><font><a name="content"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h1>Content models</h1><h2>Subsections</h2><p><ul><li><a href="#seq1">Flat sequences</a></li><li><a href="#references">Type and element references</a></li><li><a href="#optional">Optional elements</a></li><li><a href="#repeating">Repeating elements</a></li><li><a href="#attributes">Attributes</a></li><li><a href="#choice">Flat choices</a></li><li><a href="#recurrent">Recurrent element names</a></li><li><a href="#nested">Nested content models</a></li><li><a href="#ano">Anonymous types</a></li><li><a href="#fixdef">Fixed and default values</a></li><li><a href="#wild">Wildcards</a></li></ul><B>Executive summary</B><UL><LI>Element particles are mapped to properties.</LI><LI>Properties exhibit an XPath-like semantics for the child axis.</LI><LI>Sequence groups map to a group of properties for their element particles.</LI><LI>Choices are mapped like sequences + mutual exclusion semantics.</LI><LI>Optionality is modeled with null or nullable.</LI><LI>Repetition is modeled with IList.</LI><LI>Element-name recurrence maps to single properties.</LI><LI>The nesting of content models is not directly exhibited by the resulting API.</LI><LI>The API for nested content models is limited in terms of construction and updates.</LI><LI>Local element declarations of an anonymous types imply a nested class.</LI><LI>Element and attribute wildcards are mapped to special properties.</LI></UL><!-- **************************************************************************** --><font><BR /><a name="seq1"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Flat sequences</h2><p>
          Characteristics of flat sequences:
          <UL><LI>The content model is defined by a sequence group.</LI><LI>The sequence compositor occurs directly below a named complex-type element.</LI><LI>The children of the sequence group are (local) element declarations.</LI><LI>The names of the elements in the sequence are distinct.</LI></UL>
          For now, additional restrictions are assumed, for mere simplicity:
          <UL><LI>The hosting complex type does not declare any attributes.</LI><LI>The elements in the sequence are required.</LI></UL>
          Without loss of generality, we use a complex-type definition to host the content model.
          <BR />
          (That is, we could also use a root-element declaration.)
          

          <h3>Schema sample (Flat sequences)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A very simple type of addresses </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Zip</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Street</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>

          Flat sequences are mapped as follows:
          <UL><LI>(The hosting complex type is mapped to a class.)</LI><LI>The (local) element declarations are mapped to properties.</LI><LI>There are getters and setters for each property.</LI><LI>The precise mapping of element particles to properties is discussed
            <a href="#references">elsewhere</a>.</LI></UL><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Address<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Address</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Address</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>Zip</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Street</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p></p></a></font><!-- **************************************************************************** --><font><BR /><a name="references"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Type and element references</h2><p><B>Executive summary</B><UL><LI>
              There are OO
              <a href="#builtin">counterparts for the built-in XSD simple types</a>.
            </LI><LI>Element references are mapped to the class name for the referenced element.</LI><LI>Likewise for type references for complex types.</LI><LI>Derived simple types do not "nominally" participate in the mapping.</LI><LI>The name of a local element declaration defines the property name.</LI><LI>
              Element names and names of referenced types are subject to <a href="#name">name mapping</a>.
            </LI></UL>

          The following schema exercises type references for simple and complex types.

          <h3>Schema sample (Type references)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A host for the references to follow </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Customer</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Age</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">AgeType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">AddressType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A complex type to be referenced </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">AddressType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Zip</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Street</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A simple type to be referenced </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:simpleType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">AgeType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:minInclusive</FONT><font> <FONT COLOR="red">value</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:maxInclusive</FONT><font> <FONT COLOR="red">value</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">200</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:simpleType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>

          Simple-type references are mapped, by default, to references of the
          OO counterpart of the built-in XSD base type of the referenced type.
          <BR />
          The constraints for the simple type are enforced
          by the properties for the corresponding elements.
          <BR /><FONT COLOR="red"><b>Note:</b> In the current release of LINQ to XSD, setters are validated,
          but not getters. This may be change.</FONT><BR />
          Complex-type references are always mapped to the class name for the
          complex type.

          <h3>OO API (Type references)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Customer<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Customer</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Customer</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>Age</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>AddressType</font></td><td>  </td><td>Address</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> AddressType<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>AddressType</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>AddressType</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>Zip</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Street</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p>

          The following schema varies the above schema such that:
          <UL><LI>It uses element declarations instead of type definitions;</LI><LI>
              It uses element references instead of local element declarations with
              type references.
            </LI></UL><h3>Schema sample (Element references)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A host for the references to follow </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Customer</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Age</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A referable element of a complex type </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Zip</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Street</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A referable element of a simple type </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Age</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:simpleType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:minInclusive</FONT><font> <FONT COLOR="red">value</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:maxInclusive</FONT><font> <FONT COLOR="red">value</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">200</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:simpleType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>

          Element references are always mapped to "wrapper" references.
          <BR />
          This rule is applied regardless of whether the content model is or complex.

          <h3>OO API (Element references)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Customer<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Customer</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Customer</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Age</font></td><td>  </td><td>Age</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Address</font></td><td>  </td><td>Address</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Address<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Address</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Address</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>Zip</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Street</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Age<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Age</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Age</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>TypedValue</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p></p></a></font><!-- **************************************************************************** --><font><BR /><a name="optional"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Optional elements</h2><p>
          An element is optional, if the (local) element declaration is attributed as follows:
          <UL><LI>
              There is an attribute <code>minOccurs="0"</code>.
            </LI><LI>
              The value of the <code>maxOccurs</code> is 1 (which is the default).
            </LI></UL>
          The mapping of optionality depends on the mapping of the involved content type:
          <UL><LI>If the element type is mapped to a CLR-value type, then optionality maps to nullable types.</LI><LI>Otherwise, optionality is not explicitly represented by the resulting CLR reference type.</LI><LI>Clearly, all complex-content types are mapped to CLR reference types.</LI><LI>Hence, optional and required elements of a complex content type are mapped in the same way.</LI></UL><h3>Schema sample (Optional elements)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> Customer information with optional age and shipping-address information </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Customer</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Age</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">BillAddress</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">ShipAddress</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> Part 1 of street address is required; part 2 is optional </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Address</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Zip</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Street1</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Street2</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API (Use of nullable types)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Customer<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Customer</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Customer</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font><FONT COLOR="blue">int</FONT><b><FONT COLOR="blue">?</FONT></b></font></td><td>  </td><td>Age</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Address</font></td><td>  </td><td>BillAddress</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Address</font></td><td>  </td><td>ShipAddress</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Address<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Address</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Address</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>Zip</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Street1</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Street2</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p>
          Given the missing disoverability of optionality for reference types,
          the classes generated by LINQ to XSD may document optionality as part of
          the tool tips for the relevant properties.
        </p></a></font><!-- **************************************************************************** --><font><BR /><a name="repeating"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Repeating elements</h2><p>
        An element is repeating, if the element declaration is attributed as follows:
        <UL><LI>
            The value of the <code>maxOccurs</code> attribute is different from 0 and 1 (default).
          </LI><LI>
            We say that the particle is a possibly empty list particle if <code>minOccurs="0"</code>.
          </LI><LI>Otherwise, we say that the particle is a non-empty list particle.</LI></UL>
        The mapping of repeating elements is defined as follows:
        <UL><LI>
            Suppose <code>t</code> is result of mapping the element type of the particle.
          </LI><LI>
            Then, the property type for the mapped element particle is <code>IList</code> appled to <code>t</code>.
          </LI><LI>Hence, the observable CLR type does not resemble the precise occurrence constraints.</LI></UL><h3>Schema sample (Repeating elements)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A figure is a potentially empty list of lines. </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Figure</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Line</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A line consists of 2 or more points. </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Line</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Point</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">2</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Point</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xCoord</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">yCoord</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API (Use of IList interface)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Figure<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Figure</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Figure</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Line</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Line</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Line<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Line</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Line</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Point</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Point</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Point<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Point</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Point</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>xCoord</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>yCoord</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p>
        Given the missing disoverability of non-empty versus empty list status
        (or more specific bounds than 0, 1 and unbounded),
        the class that are generated by LINQ to XSD may document the status as
        part of the tool tips for the relevant properties.
      </p></a></font><!-- **************************************************************************** --><font><BR /><a name="attributes"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Attributes</h2><p>
        Attribute declarations are mapped to properties that are added to the
        class that hosts the complex type of which the attributes are part of.
        (For simplicity, it is assumed that element and attribute names are distinct
        in a given scope. Otherwise, special rules of <a href="#name">name mapping</a> apply.)

        <h3>Schema sample (A complex type with an attribute declaration)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Product</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Number</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:integer</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:attribute</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">EffDate</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:date</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">use</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">optional</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Product<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Product</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Product</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">decimal</FONT></td><td>  </td><td>Number</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font><font>System.DateTime</font><b><FONT COLOR="blue">?</FONT></b></font></td><td>  </td><td>EffDate</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p><h3>OO API (Properties for attributes)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Product<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Product</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Product</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">decimal</FONT></td><td>  </td><td>Number</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font><font>System.DateTime</font><b><FONT COLOR="blue">?</FONT></b></font></td><td>  </td><td>EffDate</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p>

        All attribute declarations can be thought as element particles in a sequence.
        <br />
        Hence, the following schema maps to the same object model as the earlier schema.

        <h3>Schema sample (Elements in place of attributes)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Product</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Number</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:integer</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">EffDate</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:date</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p></p></a></font><!-- **************************************************************************** --><font><BR /><a name="choice"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Flat choices</h2><p>
          Characteristics of flat choices:
          <UL><LI>The content model is defined by a choice group.</LI><LI>The compositor occurs directly below a complex-type element.</LI><LI>The children of the choice group are (local) element declarations.</LI><LI>The element names are distinct (required per XSD validity).</LI><LI>The element types are described by type references.</LI></UL><h3>Schema sample (Flat choice)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">BillTo</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> Both street and pobox are of type xs:string. </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:choice</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Street</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Pobox</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:choice</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>
          
          The choice group is essentially mapped as the same sequence group except that:
          <UL><LI>
              The particles are mapped to properties as if they were
              <a href="#optional">optional particles</a>.
            </LI><LI>Each of the resulting setters unsets all the other setters.</LI></UL><h3>OO API (Flat choices on element particles)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> BillTo<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>BillTo</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>BillTo</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Street</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Pobox</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p>
          
          Programmatic case discrimination choices can be based on non-null tests per
          branch that are appropriate casceded in conditionals. For a more restricted form
          of choices, convenience for construction can be provided. That is, when the
          choice at hand uses plain element particles <I>with distinct element types
          that are also mapped to different OO types</I>, then we can use the (mapped)
          types themselves to provide an overloaded constructor.

          <h3>Schema sample (A choice with distinct element types for the branches)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> Arithmetic expression forms combined by choice </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Exp</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:choice</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Const</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Add</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Add</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:choice</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> Addition as an expression form </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Add</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Left</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Exp</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Right</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Exp</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>
          
          Note that there are two constructors, corresponding to a binary choice.
          
          <h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Exp<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Exp</font>();</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Exp</font>(<font><font><FONT COLOR="blue">int</FONT><b><FONT COLOR="blue">?</FONT></b></font> Const</font>);</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Exp</font>(<font><font>Add</font> Add</font>);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Exp</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font><FONT COLOR="blue">int</FONT><b><FONT COLOR="blue">?</FONT></b></font></td><td>  </td><td>Const</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Add</font></td><td>  </td><td>Add</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Add<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Add</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Add</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Exp</font></td><td>  </td><td>Left</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Exp</font></td><td>  </td><td>Right</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p>

          The described mapping rules do not readily enable the discoverability of
          mutually exclusive properties (in the sense of choice), when compared to
          the combined use of properties (in the sense of sequence). The classes
          generated by LINQ to XSD may document the content model as part of
          the tool tips for the relevant properties.

        </p></a></font><!-- **************************************************************************** --><font><BR /><a name="recurrent"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Recurrent element names</h2><p>
        An element name is said to be recurrent in a given content model,
        if the content model comprises multiple element declarations of the
        given name. Recurrence is mapped such that all the relevant 
        element declarations are mapped to a single property with a type 
        as in the case of a repeating element particle. That is, there is no
        1:1 correspondence of element particles and properties; instead there is 1:1
        correspondence of element names and properties.
        
        <h3>Schema sample (Recurrent element names)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A figure as a list of lines </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Figure</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Line</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A line that consist of two points. </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Line</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Point</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Point</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Point</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xCoord</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">yCoord</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Figure<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Figure</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Figure</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Line</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Line</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Line<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Line</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Line</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Point</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Point</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Point<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Point</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Point</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>xCoord</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>yCoord</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p></p></a></font><!-- **************************************************************************** --><font><BR /><a name="nested"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Nested content models</h2><p><h3>Schema sample (Nested, repeating sequences)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">JobOffer</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">JobId</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">SSN</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>

        The LINQ to XSD mapping is instance-oriented. That is, the nesting of
        compositors is not represented by the API of the classes generated by LINQ
        to XSD. Instead, all element names in a content model give rise to
        properties. We refer to the discussion of "append semantics" in the 
        overview and the manual for LINQ to XSD.

        <h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> JobOffer<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>JobOffer</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>JobOffer</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>JobId</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><FONT COLOR="blue">string</FONT><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><FONT COLOR="blue">int</FONT><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>SSN</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p><!--
          <schema>
            <caption>A choice within a sequence</caption>
            <include>nested2</include>
          </schema>
          <api>
            <include>nested2</include>
          </api>
          <schema>
            <caption>A sequence within a choice</caption>
            <include>nested3</include>
          </schema>
          <api>
            <include>nested3</include>
          </api>
          --></p></a></font><!-- **************************************************************************** --><font><BR /><a name="ano"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Anonymous types</h2><p>

        The mapping for root elements with anonymous types was defined
        <a href="#ac-root">elsewhere</a>.
        The mapping for local elements with anonymous simple types is trivial
        because the (derived) simple type or the type union or list type is
        reduced to the base built-in type as far as the API type is concerned.
        The case of local elements with anonymous complex types remains.

        <h3>Schema sample (A schema with nested, anonymous, complex types)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Bib</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Book</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                              </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                   </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:choice</FONT><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                        </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Title</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                                        </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Author</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                             </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                                  </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                                       </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Last</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                                                       </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">First</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                                                  </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                                             </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                                        </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                                        </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Editor</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                             </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                                  </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                                       </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Last</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                                                       </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">First</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                                                       </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Affiliation</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                                            </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                                                 </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:simpleContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                                                      </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:extension</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                                                           </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:attribute</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Type</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">use</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">required</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                                                                      </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:extension</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                                                                 </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:simpleContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                                                            </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                                                       </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                                                  </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                                             </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                                        </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                                        </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Publisher</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                                        </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Price</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:decimal</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                                   </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:choice</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                              </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                              </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:attribute</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Year</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:unsignedShort</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">use</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">required</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                              </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:attribute</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Anson</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:boolean</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">use</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">optional</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                              </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:attribute</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Joe</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">use</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">optional</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>

        By default, such nesting of elements and types is mapped to nesting of OO classes.

        <h3>OO API (Default mapping)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Bib<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Bib</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Bib</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><tr><td><table><tr><td>   </td><td><table><tr><td><b><FONT COLOR="blue">class</FONT></b> BookLocalType<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>BookLocalType</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>BookLocalType</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><tr><td><table><tr><td>   </td><td><table><tr><td><b><FONT COLOR="blue">class</FONT></b> AuthorLocalType<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>AuthorLocalType</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>AuthorLocalType</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Last</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>First</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></td></tr><tr><td>   </td><td><table><tr><td><b><FONT COLOR="blue">class</FONT></b> EditorLocalType<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>EditorLocalType</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>EditorLocalType</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><tr><td><table><tr><td>   </td><td><table><tr><td><b><FONT COLOR="blue">class</FONT></b> AffiliationLocalType<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>AffiliationLocalType</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>AffiliationLocalType</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>TypedValue</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Type</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></td></tr></table></td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Last</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>First</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>AffiliationLocalType</font></td><td>  </td><td>Affiliation</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></td></tr></table></td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><FONT COLOR="blue">string</FONT><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Title</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>AuthorLocalType</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Author</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>EditorLocalType</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Editor</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><FONT COLOR="blue">string</FONT><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Publisher</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><FONT COLOR="blue">decimal</FONT><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Price</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">ushort</FONT></td><td>  </td><td>Year</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font><FONT COLOR="blue">bool</FONT><b><FONT COLOR="blue">?</FONT></b></font></td><td>  </td><td>Anson</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Joe</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></td></tr></table></td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>BookLocalType</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Book</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p>

        However, one can also request a transformation for de-anonymization.
        The topic of schema normalization is discussed in the LINQ to XSD manual.
        De-anonymization modifies the mapping such that anonymous complex types
        are defined globally, while the local element names are leveraged as 
        type names, when this is possible without introducing type clashes.
        Accordingly, the resulting object model does not comprise any nested
        classes.

        <h3>OO API (Mapping with de-anonymization)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Bib<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Bib</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Bib</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Book</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Book</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Book<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Book</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Book</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><FONT COLOR="blue">string</FONT><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Title</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>author</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>author</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Editor</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Editor</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><FONT COLOR="blue">string</FONT><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Publisher</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><FONT COLOR="blue">decimal</FONT><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Price</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">ushort</FONT></td><td>  </td><td>Year</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font><FONT COLOR="blue">bool</FONT><b><FONT COLOR="blue">?</FONT></b></font></td><td>  </td><td>Anson</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Joe</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> author<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>author</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>author</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Last</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>First</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Editor<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Editor</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Editor</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Last</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>First</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Affiliation</font></td><td>  </td><td>Affiliation</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Affiliation<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Affiliation</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Affiliation</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>TypedValue</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Type</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p></p></a></font><!-- **************************************************************************** --><font><BR /><a name="fixdef"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Fixed and default values</h2><p><FONT COLOR="red"><b>Note:</b> 
          The current release of LINQ to XSD provides incomplete/disabled support
          for fixed and default values. At the time of writing, default attributes
          were still to be expected for the release, but all other forms of fixed
          and default values were not expected for the release.
        </FONT></p></a></font><!-- **************************************************************************** --><font><BR /><a name="wild"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Wildcards</h2><p><h3>Schema sample (A schema with wildcards)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">ProductType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Number</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:any</FONT><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">namespace</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">##other</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">processContents</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">lax</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:anyAttribute</FONT><font> <FONT COLOR="red">namespace</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">##other</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">processContents</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">skip</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>

        Element wildcards are mapped to a designated API member.
        <BR /><FONT COLOR="red"><b>Note:</b> Attribute wildcards are ignored by the mapping in the current release of LINQ to XSD and hence require the untyped API.</FONT><h3>OO API (Designated members for wildcards)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> ProductType<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>ProductType</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>ProductType</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Number</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IEnumerable<b><FONT COLOR="blue">&lt;</FONT></b><font>System.Xml.Linq.XElement</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Any</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>;  }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p>

        The <code>Any</code> property is always of type <code>XElement</code> or
        a list type thereof. Occurrence constraints and recurrence of
        <code>Any</code> are subject to the same rules as for normal element
        particles. That is, if the <code>Any</code> is neither repeating nor
        recurring, then the generated property is of type <code>XElement</code>.
        Otherwise, the property is of the list type.
        
      </p></a></font></p></a><BR /></font><font><a name="substitution"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h1>Substitution forms</h1><h2>Subsections</h2><p><ul><li><a href="#ct-extension">Complex-type extension</a></li><li><a href="#st-extension">Extension of simple content</a></li><li><a href="#st-restriction">Simple-type restriction</a></li><li><a href="#ct-restriction">Complex-type restriction</a></li><li><a href="#subst">Susbstitution groups</a></li><li><a href="#control">Control of substitutability</a></li></ul><!-- **************************************************************************** --><font><BR /><a name="ct-extension"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Complex-type extension</h2><p>
          For simplicity, the following assumptions are made:
          <UL><LI>A complex base type is extended by complex content.</LI><LI>Substitutability is unrestricted, i.e., <code>block</code> and <code>final</code> are not used.</LI><LI>The derived content model is a sequence on element particles.</LI><LI>The derived type is non-anonymous.</LI></UL><h3>Schema sample</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A base type of products </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Product</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Number</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:integer</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> shirt extends product </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Shirt</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:extension</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Product</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Size</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Color</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:extension</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> hat extends product </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Hat</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:extension</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Product</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Size</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:extension</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>

          Such type derivation by extension is mapped as follows:
          <UL><LI>Both base type and derived type are mapped to classes.</LI><LI>The derivation relationship is mapped to OO class inheritance.</LI><LI>That is, the "derived" class inherits from the "base" class.</LI><LI>Roots in the derivation hierarchy inherit from "XTypedElement" as usual.</LI><LI>The properties for the added particles appear in the derived class.</LI></UL><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Product<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Product</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Product</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">decimal</FONT></td><td>  </td><td>Number</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Shirt<font> : <font>Product</font></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Shirt</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Shirt</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Size</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Color</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Hat<font> : <font>Product</font></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Hat</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Hat</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>Size</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p></p></a></font><font><BR /><a name="st-extension"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Extension of simple content</h2><p><FONT COLOR="red"><b>Note:</b> This topic is not documented in the current release of LINQ to XSD.</FONT><!--                  
          <schema>
            <include>extension2</include>
          </schema>
          <api>
            <include>extension2</include>
          </api>
          --></p></a></font><!-- **************************************************************************** --><font><BR /><a name="st-restriction"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Simple-type restriction</h2><p><FONT COLOR="red"><b>Note:</b> This topic is not documented in the current release of LINQ to XSD.</FONT><!--
          <schema>
            <caption>???</caption>
            <include>union1</include>
          </schema>
          
          <schema>
            <caption>???</caption>
            <include>union2</include>
          </schema>
          
          <api>
            <caption>???</caption>
            <include>union1</include>
          </api>
          
          <schema>
            <caption>???</caption>
            <include>list1</include>
          </schema>
          
          <api>
            <caption>???</caption>
            <include>list1</include>
          </api>          
          --></p></a></font><!-- **************************************************************************** --><font><BR /><a name="ct-restriction"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Complex-type restriction</h2><p><h3>Schema sample</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A base type of products </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Product</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Number</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:integer</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Size</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Color</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> A restriction of product </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">RigidProduct</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Product</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Number</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:integer</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Size</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:restriction</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>
          
          The derived type is mapped to a subclass of the class for the base type.
          <BR /><FONT COLOR="red"><b>Note:</b> In the current release of LINQ to XSD, the restrictions are not checked in any way.</FONT><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Product<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Product</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Product</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">decimal</FONT></td><td>  </td><td>Number</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font><FONT COLOR="blue">int</FONT><b><FONT COLOR="blue">?</FONT></b></font></td><td>  </td><td>Size</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Color</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> RigidProduct<font> : <font>Product</font></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>RigidProduct</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>RigidProduct</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><font /><tr><td>}</td></tr></table></font></p></p></a></font><!-- **************************************************************************** --><font><BR /><a name="subst"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Susbstitution groups</h2><p>

          Here is an example for using substitution groups.
          <BR />
          (We continue the example on <a href="#ct-extension">type derivation by extension for complex types</a>.) 
          
          <h3>Schema sample (Substitution groups)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Product</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">ProductType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Shirt</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">ShirtType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Hat</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">HatType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">ProductType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> product details omitted </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">ShirtType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:extension</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">ProductType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> shirt details omitted </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:extension</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">HatType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:extension</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">ProductType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> hat details omitted </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:extension</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p>


          Substitution groups are mapped in accordance to the
          <a href="#nc-root">
              combined use of element declarations and complex-type definitions
            </a>.

          <BR />          
          In addition, the following mapping rules apply:
          <UL><LI>The type derivation hierarchy is mapped as in the case of plain type derivation.</LI><LI>The global element declarations are mapped as usual except for the superclass constraint.</LI><LI>Classes for substitution group members inherit from the class for the head.</LI></UL><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> ProductType<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>ProductType</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>ProductType</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><font /><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> ShirtType<font> : <font>ProductType</font></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>ShirtType</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>ShirtType</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><font /><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> HatType<font> : <font>ProductType</font></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>HatType</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>HatType</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><font /><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Product<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Product</font>();</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Product</font>(<font><font>ProductType</font> content</font>);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Product</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>ProductType</font></td><td>  </td><td>Content</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>;  }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Shirt<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Shirt</font>();</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Shirt</font>(<font><font>ShirtType</font> content</font>);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Shirt</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>ShirtType</font></td><td>  </td><td>Content</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>;  }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Hat<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Hat</font>();</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Hat</font>(<font><font>HatType</font> content</font>);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Hat</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>HatType</font></td><td>  </td><td>Content</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>;  }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p></p></a></font><!-- **************************************************************************** --><font><BR /><a name="control"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Control of substitutability</h2><p><FONT COLOR="red"><b>Note:</b> This topic is not documented in the current release of LINQ to XSD.</FONT><!-- 
          Talk about block and final.
          --></p></a></font><!-- **************************************************************************** --></p></a><BR /></font><font><a name="trivia"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h1>Trivially mapped XSD constructs</h1><h2>Subsections</h2><p><ul><li><a href="#group">Group definitions</a></li><li><a href="#gad">Global attribute declarations</a></li><li><a href="#gagd">Global attribute-group definitions</a></li><li><a href="#redefine">Redefinitions</a></li><li><a href="#identity">Identity constraints</a></li><li><a href="#mixed">Mixed content</a></li></ul><!-- **************************************************************************** --><font><BR /><a name="group"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Group definitions</h2><p>
          These definitions are not mapped. References to these definitions are
          mapped by inlining them in the place of the reference. <FONT COLOR="red"><b>Note:</b> This approach
          may be refined in a future version of LINQ to XSD so that groups are mapped
          for better code factorization.</FONT></p></a></font><!-- **************************************************************************** --><font><BR /><a name="gad"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Global attribute declarations</h2><p>
          These declarations are not mapped.
          <br />
          References to these declarations are mapped by inlining them in the place of the reference.
        </p></a></font><!-- **************************************************************************** --><font><BR /><a name="gagd"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Global attribute-group definitions</h2><p>
          These definitions are not mapped.
          <br />
          References to these definitions are mapped by inlining them in the place of the reference.
        </p></a></font><!-- **************************************************************************** --><font><BR /><a name="redefine"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Redefinitions</h2><p>
          The System.Xml.Schema semantics of redefinitions applies.
          <BR />
          Essentially, this implies that redefinitions override the original definitions.
        </p></a></font><!-- **************************************************************************** --><font><BR /><a name="identity"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Identity constraints</h2><p>
          Identity constraints are not taken into account, in any way.
          <BR />
          Normal validation is supposed to check these constraints.
        </p></a></font><!-- **************************************************************************** --><font><BR /><a name="mixed"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Mixed content</h2><p>
          There are no designated API members for mixed content.
          <BR />
          Interim text is discoverable and definable through the XElement interface.
          <BR />
          Tool tips may document the mixed-content status of a class.
          <BR /></p></a></font></p></a><BR /></font><font><a name="builtin"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h1>Appendix: Mapping of built-in simple types</h1><p>
      By default, each and every XSD built-in simple type is mapped to a CLR type,
      mostly to a CLR <I>value</I> type or to string. This default mapping is
      exercised below by means of a content model with an element particle for
      each and every built-in type.
      
      <h3>Schema sample (All of XSD's built-in simple types)</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> An illustrative type that exercises all built-in simple types. </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> Indeed, all these types are listed in alphabetic order. </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">simpleType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsAnySimpleType</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:anySimpleType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsAnyURI</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:anyURI</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsBase64Binary</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:base64Binary</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsBoolean</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:boolean</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsByte</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:byte</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsDate</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:date</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsDateTime</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:dateTime</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsENTITIES</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:ENTITIES</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsENTITY</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:ENTITY</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsFloat</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:float</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsDecimal</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:decimal</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsDouble</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:double</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsDuration</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:duration</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsGDay</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:gDay</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsGMonth</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:gMonth</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsGMonthDay</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:gMonthDay</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsGYear</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:gYear</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsGYearMonth</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:gYearMonth</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsHexBinary</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:hexBinary</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsID</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:ID</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsIDREF</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:IDREF</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsIDREFS</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:IDREFS</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsInt</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsInteger</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:integer</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsLanguage</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:language</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsLong</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:long</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsName</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:Name</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsNCName</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:NCName</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsNegativeInteger</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:negativeInteger</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsNMTOKEN</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:NMTOKEN</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsNMTOKENS</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:NMTOKENS</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsNonNegativeInteger</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:nonNegativeInteger</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsNonPositiveInteger</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:nonPositiveInteger</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsNormalizedString</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:normalizedString</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">!--</FONT></code><b> xs:NOTATION was omitted since it is only used in derivations. </b><code><FONT COLOR="blue">--</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsPositiveInteger</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:positiveInteger</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsQName</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:QName</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsUnsignedByte</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:unsignedByte</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsUnsignedInt</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:unsignedInt</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsUnsignedLong</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:unsignedLong</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsUnsignedShort</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:unsignedShort</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsShort</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:short</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsString</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsTime</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:time</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xsToken</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:token</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API (CLR counteparts for XSD built-in simple types)</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> simpleType<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>simpleType</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>simpleType</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>xsAnySimpleType</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.Uri</font></td><td>  </td><td>xsAnyURI</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.Byte[]</font></td><td>  </td><td>xsBase64Binary</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">bool</FONT></td><td>  </td><td>xsBoolean</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">sbyte</FONT></td><td>  </td><td>xsByte</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.DateTime</font></td><td>  </td><td>xsDate</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.DateTime</font></td><td>  </td><td>xsDateTime</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><FONT COLOR="blue">string</FONT><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>xsENTITIES</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>xsENTITY</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">float</FONT></td><td>  </td><td>xsFloat</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">decimal</FONT></td><td>  </td><td>xsDecimal</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">double</FONT></td><td>  </td><td>xsDouble</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.TimeSpan</font></td><td>  </td><td>xsDuration</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.DateTime</font></td><td>  </td><td>xsGDay</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.DateTime</font></td><td>  </td><td>xsGMonth</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.DateTime</font></td><td>  </td><td>xsGMonthDay</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.DateTime</font></td><td>  </td><td>xsGYear</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.DateTime</font></td><td>  </td><td>xsGYearMonth</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.Byte[]</font></td><td>  </td><td>xsHexBinary</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>xsID</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>xsIDREF</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><FONT COLOR="blue">string</FONT><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>xsIDREFS</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>xsInt</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">decimal</FONT></td><td>  </td><td>xsInteger</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>xsLanguage</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">long</FONT></td><td>  </td><td>xsLong</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>xsName</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>xsNCName</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">decimal</FONT></td><td>  </td><td>xsNegativeInteger</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>xsNMTOKEN</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><FONT COLOR="blue">string</FONT><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>xsNMTOKENS</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">decimal</FONT></td><td>  </td><td>xsNonNegativeInteger</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">decimal</FONT></td><td>  </td><td>xsNonPositiveInteger</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>xsNormalizedString</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">decimal</FONT></td><td>  </td><td>xsPositiveInteger</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.Xml.XmlQualifiedName</font></td><td>  </td><td>xsQName</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">byte</FONT></td><td>  </td><td>xsUnsignedByte</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">uint</FONT></td><td>  </td><td>xsUnsignedInt</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">ulong</FONT></td><td>  </td><td>xsUnsignedLong</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">ushort</FONT></td><td>  </td><td>xsUnsignedShort</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">short</FONT></td><td>  </td><td>xsShort</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>xsString</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>System.DateTime</font></td><td>  </td><td>xsTime</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>xsToken</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p></p></a><BR /></font><font><a name="name"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h1>Appendix: Name mapping</h1><p><FONT COLOR="red"><b>Note:</b> This topic is not documented in the current release of LINQ to XSD.</FONT></p></a><BR /></font><font><a name="namespace"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h1>Appendix: Namespace mapping</h1><p><FONT COLOR="red"><b>Note:</b> This topic is not documented in the current release of LINQ to XSD.</FONT></p></a><BR /></font><font><a name="samples"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h1>Appendix: More samples</h1><h2>Subsections</h2><p><ul><li><a href="#orders">Purchase orders</a></li><li><a href="#invoice">Invoices for orders</a></li><li><a href="#company">Company organization</a></li><li><a href="#language">Language syntax</a></li></ul><!-- **************************************************************************** --><font><BR /><a name="orders"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Purchase orders</h2><p>
          The following schema is used in the LINQ to XSD overview.
          <h3>Schema sample</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Batch</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">PurchaseOrder</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">PurchaseOrder</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">CustId</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Item</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Item</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">ProdId</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Price</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:double</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Quantity</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Batch<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Batch</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Batch</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>PurchaseOrder</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>PurchaseOrder</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> PurchaseOrder<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>PurchaseOrder</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>PurchaseOrder</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>CustId</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Item</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Item</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Item<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Item</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Item</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>ProdId</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">double</FONT></td><td>  </td><td>Price</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>Quantity</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p></p></a></font><!-- **************************************************************************** --><font><BR /><a name="invoice"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Invoices for orders</h2><p>
          The following schema is used in the XML 2006 paper.
          <h3>Schema sample</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:schema</FONT><font> <FONT COLOR="red">xmlns:xmlns</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Invoice</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Street</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">City</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Zip</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">State</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Position</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                              </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                                   </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">ProdId</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                                   </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Price</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">double</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                                   </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Quantity</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                              </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Total</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">double</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Invoice<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Invoice</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Invoice</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Street</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>City</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Zip</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>State</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Position</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Position</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">double</FONT></td><td>  </td><td>Total</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Position<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Position</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Position</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>ProdId</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">double</FONT></td><td>  </td><td>Price</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">int</FONT></td><td>  </td><td>Quantity</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p></p></a></font><!-- **************************************************************************** --><font><BR /><a name="company"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Company organization</h2><p>
          The following schema is used in the LINQ to XSD demo.
          <h3>Schema sample</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Company</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Department</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Department</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Label</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Manager</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">EmployeeType</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Member</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:attribute</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Deptno</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Member</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:choice</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Employee</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">EmployeeType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">ref</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Department</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:choice</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:element</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">EmployeeType</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Name</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Salary</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:double</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Company<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Company</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Company</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Department</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Department</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Department<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Department</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Department</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Label</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>EmployeeType</font></td><td>  </td><td>Manager</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Member</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Member</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font><FONT COLOR="blue">int</FONT><b><FONT COLOR="blue">?</FONT></b></font></td><td>  </td><td>Deptno</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Member<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Member</font>();</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Member</font>(<font><font>EmployeeType</font> Employee</font>);</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Member</font>(<font><font>Department</font> Department</font>);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Member</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>EmployeeType</font></td><td>  </td><td>Employee</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Department</font></td><td>  </td><td>Department</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> EmployeeType<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>EmployeeType</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>EmployeeType</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Name</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">double</FONT></td><td>  </td><td>Salary</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p></p></a></font><!-- **************************************************************************** --><font><BR /><a name="language"><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font><h2>Language syntax</h2><p>
          The following schema is used in the LINQ to XSD demo.
          <h3>Schema sample</h3><p><font><font /><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:schema</FONT><font> <FONT COLOR="red">xmlns:xs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">http://www.w3.org/2001/XMLSchema</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Program</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Block</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Expr</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">abstract</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">true</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Constant</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:extension</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Expr</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:choice</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Integer</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:int</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Boolean</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:boolean</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:choice</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:extension</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Variable</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:extension</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Expr</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Id</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:extension</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Block</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:extension</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Expr</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Decl</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Decl</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">minOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">0</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Expr</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Expr</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">maxOccurs</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">unbounded</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:extension</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Decl</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Id</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Type</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Type</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Type</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">abstract</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">true</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Integer</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:extension</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Type</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Boolean</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:extension</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Type</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Assign</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:extension</FONT><font> <FONT COLOR="red">base</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Expr</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><font><code><FONT COLOR="blue">&gt;</FONT></code><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Id</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">xs:string</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font><font>                         </font><code><FONT COLOR="blue">&lt;</FONT></code><FONT COLOR="maroon">xs:element</FONT><font> <FONT COLOR="red">name</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Rhs</FONT><FONT COLOR="blue">"</FONT></font><font> <FONT COLOR="red">type</FONT><FONT COLOR="blue">=</FONT><FONT COLOR="blue">"</FONT><FONT COLOR="blue">Expr</FONT><FONT COLOR="blue">"</FONT></font><font><code><FONT COLOR="blue">/</FONT></code><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>                    </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:sequence</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>               </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:extension</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>          </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexContent</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font>     </font><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:complexType</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></font><font><BR /><font /><code><FONT COLOR="blue">&lt;</FONT></code><code><FONT COLOR="blue">/</FONT></code><FONT COLOR="maroon">xs:schema</FONT><code><FONT COLOR="blue">&gt;</FONT></code></font></font></p><h3>OO API</h3><p><font><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Expr<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Expr</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Expr</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><font /><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Constant<font> : <font>Expr</font></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Constant</font>();</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Constant</font>(<font><font><FONT COLOR="blue">int</FONT><b><FONT COLOR="blue">?</FONT></b></font> Integer</font>);</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Constant</font>(<font><font><FONT COLOR="blue">bool</FONT><b><FONT COLOR="blue">?</FONT></b></font> Boolean</font>);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Constant</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font><FONT COLOR="blue">int</FONT><b><FONT COLOR="blue">?</FONT></b></font></td><td>  </td><td>Integer</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font><FONT COLOR="blue">bool</FONT><b><FONT COLOR="blue">?</FONT></b></font></td><td>  </td><td>Boolean</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Variable<font> : <font>Expr</font></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Variable</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Variable</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Id</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Block<font> : <font>Expr</font></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Block</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Block</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Decl</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Decl</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Expr</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Expr</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Decl<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Decl</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Decl</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Id</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Type</font></td><td>  </td><td>Type</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Type<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Type</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Type</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><font /><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Integer<font> : <font>Type</font></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Integer</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Integer</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><font /><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Boolean<font> : <font>Type</font></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Boolean</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Boolean</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><font /><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Assign<font> : <font>Expr</font></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Assign</font>();</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Assign</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><FONT COLOR="blue">string</FONT></td><td>  </td><td>Id</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Expr</font></td><td>  </td><td>Rhs</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table><table><tr><td><b><FONT COLOR="blue">class</FONT></b> Program<font> : <small><i><font>XTypedElement</font></i></small></font></td></tr><tr><td>{</td></tr><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Program</font>();</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">constructor</FONT></b></td><td>  </td><td><font>Program</font>(<font><font>Block</font> content</font>);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">explicit</FONT></b> <b><FONT COLOR="blue">cast</FONT></b></td><td>  </td><td><font>Program</font>(<font>System.Xml.Linq.XElement</font> xe);</td></tr></table></td></tr><font /><tr><td><table><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>Block</font></td><td>  </td><td>Content</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>;  }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Decl</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Decl</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr><tr><td>   </td><td><b><FONT COLOR="blue">property</FONT></b></td><td>  </td><td><font>IList<b><FONT COLOR="blue">&lt;</FONT></b><font>Expr</font><b><FONT COLOR="blue">&gt;</FONT></b></font></td><td>  </td><td>Expr</td><td>  </td><td>{ <b><FONT COLOR="blue">get</FONT></b>; <b><FONT COLOR="blue">set</FONT></b>; }</td></tr></table></td></tr><tr><td>}</td></tr></table></font></p></p></a></font></p></a><BR /></font></body><font><BR /><TABLE WIDTH="100%" BORDER="0" BGCOLOR="#ffffcc"><tr><td><center><small>Copyright (C) 2006-2007 Microsoft Corporation. All rights reserved.</small></center></td></tr></TABLE><p /><BR /></font></html>